import React from 'react'
import { connect } from 'react-redux'
import { Input } from 'semantic-ui-react'
import { listTable as listTableDuck } from 'ducks'

const Search = ({ actionChangeSearch, ...others }) => (
  <Input onChange={(e, { value }) => actionChangeSearch(value)} {...others} />
)

const mapDispatchToProps = {
  actionChangeSearch: listTableDuck.creators.actionChangeSearch,
}

export default connect(
  null,
  mapDispatchToProps,
)(Search)
